package edu.towson.greenteam.order.strategy;

/*public class OrderPrepFIFOStrategy implements IStrategy {

		@Override
		public boolean dequeue() {
			boolean rtn = false;
			if (!currentOrders.isEmpty() && GetFirstNotPreparedOrder() != null) {
	        	Order firstNotPreparedOrder = GetFirstNotPreparedOrder();
	            if (firstNotPreparedOrder.getMenuItem().getPrepTime() == ctcount) {
	                firstNotPreparedOrder.setPrepared(true);
	                totalNumOrders++;  //track num orders & prep time for avg prep time
	                totalPrepTime += firstNotPreparedOrder.getMenuItem().getPrepTime();
	                rtn = true;
	                Logger.GetInstance().LogMessage("tablePrep: " + firstNotPreparedOrder.getTable().getId());
	                ctcount = 0;
	                setChanged();
	                if (allItemsPrepared(firstNotPreparedOrder.getTable())){
	                	setAllItemsServed(firstNotPreparedOrder.getTable()); //set all items served
	                	Logger.GetInstance().LogMessage("SERVED TABLE: " + firstNotPreparedOrder.getTable().getId());

	                	Tab newTab = createTab(firstNotPreparedOrder.getTable()); //make tab set as paid
	                	newTab.setPaymentstatus(true);
	                	i.getTabs().add(newTab);
	                	Logger.GetInstance().LogMessage("PAID TABLE: " + firstNotPreparedOrder.getTable().getId());
	                    //TODO destroy orders
	                    firstNotPreparedOrder.getTable().clearOrders();

	                    notifyObservers(firstNotPreparedOrder);
	                }
	            } else if (firstNotPreparedOrder.getMenuItem().getPrepTime() < ctcount)
	            	ctcount=0;
	        }
			return rtn;
		}
	}*/